package com.asialjim.wechat.pojo.account;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>CLASS DESCRIPTION <i>[ NAME: WeChatAccountType ]</i></h2><strong>
 * <p> we chat open platform account type
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/1/26   &nbsp;&nbsp; JDK 8
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum WeChatAccountType{

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * 企业号
     */
    ENTERPRISE("ENTERPRISE"),

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * 小程序
     */
    MINI_PROGRAM("MINI_PROGRAM"),

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * 小游戏
     */
    MINI_GAME("MINI_GAME"),

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * 公众号
     */
    OFFICIAL_ACCOUNT("OFFICIAL_ACCOUNT"),

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * 开放平台
     */
    OPEN_PLATFORM("OPEN_PLATFORM"),

    /**
     * <h3>FIELD DESCRIPTION</h3>
     * 微信支付
     */
    PAY("PAY");

    private final String name;
    public static WeChatAccountType nameOf(String name){
        return Arrays.stream(values()).filter(value ->value.getName().equals(name)).findFirst().orElse(OFFICIAL_ACCOUNT);
    }
}